<h1>Listado de Departamentos</h1>
<% if flash[:notice] %>
    <div id="notice"><%= flash[:notice] %></div>
<% end %>
<% if @shared_departments.size > 0 %>
<br />

<table class="paginated_table sorted_table">
  <thead>
  <tr>
    <th>Nombre</th>
    <th>Acciones</th>
  </tr>
</thead>
<tbody>
<% @shared_departments.each do |shared_department| %>
  <tr>
    <td><%= shared_department.name %></td>
    <td>
      <%= link_to image_tag("navi/search-16-ns.png", :border => 0,:title=>"Mostrar"), shared_department%>
      <% if (user_signed_in? && ([2].include?(current_user.role))) %>
    <%= link_to image_tag("navi/pencil-16-ns.png", :border => 0,:title=>"Editar"), edit_shared_department_path(shared_department) %>
    <%= link_to image_tag("navi/cross-16-ns.png", :border => 0,:title=>"Eliminar"), shared_department, :confirm => 'Esta Seguro?', :method => :delete %>
      <%end%>
    </td>  
  </tr>
<% end %>
  </tbody>
</table>
<% else %>
  <p>Ningún Departamento Encontrado</p>
<% end %>
<br />
<% if (user_signed_in? && ([2].include?(current_user.role))) %>
<%= link_to 'Nuevo Departamento', new_shared_department_path %>
<%end%>
